package org.opens.pattern;

import jdk.nashorn.internal.runtime.regexp.joni.Regex;

public class DatePattern {

    public static final String ISO_DATE_REGEX = "\\d{4}-\\d{2}-\\d{2}";

    public static final String ISO_TIME_REGEX = "\\d{2}:\\d{2}:\\d{2}";

    public static final String ISO_DATETIME_REGEX = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}";

    public static void main(String[] args) {
        String str1 = "2012-08-23";
        String str2 = "12:08:23";

        System.out.println(str1.matches(ISO_DATE_REGEX));
        System.out.println(str2.matches(ISO_DATE_REGEX));
        System.out.println(str1.matches(ISO_TIME_REGEX));
        System.out.println(str2.matches(ISO_TIME_REGEX));
    }

}
